﻿<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="../Master.xslt" type="text/xsl"?>
<content doctype="xhtml1-strict">
  <html output:xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:output="urn:output">
    <head>
      <title>Helper templates</title>
      <meta name="description" content="Xslt Templates for controls" />
      <link rel="stylesheet" type="text/css" href="/_Content/Site.css" />
      <style type="text/css">
        button em
        {
        font-style: normal;
        font-weight: normal;
        text-decoration: underline;
        }
      </style>
      <style id="accessoff" type="text/css">
        button em
        {
        text-decoration: none !important;
        }
      </style>
      <!-- Fix non standard button element behavior in IE prior to v8 -->
      <ifie test="lt IE 8">
        <style type="text/css">
          button { behavior: url(../_scripts/button.htc); }
        </style>
      </ifie>
      <script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
      <script language="javascript">
        <![CDATA[
      
        $(document).ready(function() {
          var _stylesheetText = '';
          
          $(document.body).keydown(function(e) {
            var _accessKeyStylesheet = $('#accessoff');
            _accessKeyStylesheet = document.styleSheets['accessoff'] || $('#accessoff');
            
            if (e.keyCode == 18 || e.keyCode == 17) {
              // alt
              _accessKeyStylesheet.disabled = true;
              if (_accessKeyStylesheet.innerText !== '') {
                _stylesheetText = _accessKeyStylesheet.innerText;
                _accessKeyStylesheet.innerText = '';
              }
            } else {
              _accessKeyStylesheet.disabled = false;
              if (_stylesheetText !== '')
                _accessKeyStylesheet.innerText = _stylesheetText;
            }
          });
          
          $(document.body).keyup(function(e) {
            var _accessKeyStylesheet = $('#accessoff');
            _accessKeyStylesheet = document.styleSheets['accessoff'] || $('#accessoff');
            _accessKeyStylesheet.disabled = false;
            if (_stylesheetText !== '')
              _accessKeyStylesheet.innerText = _stylesheetText;
          });
        });          
]]>
      </script>
    </head>
    <body>
      <pageContent>
        Access button:
        <accessbutton id="button1" name="button" value="something" onclick="alert('Something')">Do &amp;Something</accessbutton>
        <accessbutton id="button2" name="button" value="nothing" onclick="alert('Nothing')">Do N&amp;othing</accessbutton>
        Listbox:
        <listbox id="listBox" name="listBox" default="abc" field="BasicModel/Field1">
          <listitem value="abc">ABC</listitem>
          <listitem value="def">DEF</listitem>
        </listbox>
        <debug />
        <wizardNav name="SampleControlTemplates" />
      </pageContent>
    </body>
  </html>
</content>